﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

public partial class register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            string sex;
            if (radFemale.Checked == true)
            {
                sex = "女";
            }
            else
            {
                sex = "男";
            }
            User m = new User(txtUserName.Value, txtPassword.Value, sex, txtEmail.Value);
            if (m.IsCreatUser() == 1)
            {
                Response.Redirect("index.aspx");
            }
            else
            {
                lbErr.Text = "用户名已存在！";
            }
        }
    }
}